package swpy.pickle {
	internal class Opcodes
	{
		public static const HIGHEST_PROTOCOL:uint = 0x03;
		public static const DEFAULT_PROTOCOL:uint = HIGHEST_PROTOCOL;
		
		// Pickle opcodes.  See pickletools.py for extensive docs.  The listing
		// here is in kind-of alphabetical order of 1-character pickle code.
		// pickletools groups them by purpose.
		
		public static const MARK:uint             = 0x28; // "(" push special markobject on stack
		public static const STOP:uint             = 0x2E; // "." every pickle ends with STOP
		public static const POP:uint              = 0x30; // "0" discard topmost stack item
		public static const POP_MARK:uint         = 0x31; // "1" discard stack top through topmost markobject
		public static const DUP:uint              = 0x32; // "2" duplicate top stack item
		public static const FLOAT:uint            = 0x46; // "F" push float object; decimal string argument
		public static const INT:uint              = 0x49; // "I" push integer or bool; decimal string argument
		public static const BININT:uint           = 0x4A; // "J" push four-byte signed int
		public static const BININT1:uint          = 0x4B; // "K" push 1-byte unsigned int
		public static const LONG:uint             = 0x4C; // "L" push long; decimal string argument
		public static const BININT2:uint          = 0x4D; // "M" push 2-byte unsigned int
		public static const NONE:uint             = 0x4E; // "N" push None
		public static const PERSID:uint           = 0x50; // "P" push persistent object; id is taken from string arg
		public static const BINPERSID:uint        = 0x51; // "Q" "       "         "  ;  "  "   "     "  stack
		public static const REDUCE:uint           = 0x52; // "R" apply callable to argtuple, both on stack
		public static const STRING:uint           = 0x53; // "S" push string; NL-terminated string argument
		public static const BINSTRING:uint        = 0x54; // "T" push string; counted binary string argument
		public static const SHORT_BINSTRING:uint  = 0x55; // "U" "     "   ;    "      "       "      " < 256 bytes
		public static const UNICODE:uint          = 0x56; // "V" push Unicode string; raw-unicode-escaped"d argument
		public static const BINUNICODE:uint       = 0x58; // "X" "     "       "  ; counted UTF-8 string argument
		public static const APPEND:uint           = 0x61; // "a" append stack top to list below it
		public static const BUILD:uint            = 0x62; // "b" call __setstate__ or __dict__.update()
		public static const GLOBAL:uint           = 0x63; // "c" push self.find_class(modname, name); 2 string args
		public static const DICT:uint             = 0x64; // "d" build a dict from stack items
		public static const EMPTY_DICT:uint       = 0x7D; // "}" push empty dict
		public static const APPENDS:uint          = 0x65; // "e" extend list on stack by topmost stack slice
		public static const GET:uint              = 0x67; // "g" push item from memo on stack; index is string arg
		public static const BINGET:uint           = 0x68; // "h" "    "    "    "   "   "  ;   "    " 1-byte arg
		public static const INST:uint             = 0x69; // "i" build & push class instance
		public static const LONG_BINGET:uint      = 0x6A; // "j" push item from memo on stack; index is 4-byte arg
		public static const LIST:uint             = 0x6C; // "l" build list from topmost stack items
		public static const EMPTY_LIST:uint       = 0x5D; // "]" push empty list
		public static const OBJ:uint              = 0x6F; // "o" build & push class instance
		public static const PUT:uint              = 0x70; // "p" store stack top in memo; index is string arg
		public static const BINPUT:uint           = 0x71; // "q" "     "    "   "   " ;   "    " 1-byte arg
		public static const LONG_BINPUT:uint      = 0x72; // "r" "     "    "   "   " ;   "    " 4-byte arg
		public static const SETITEM:uint          = 0x73; // "s" add key+value pair to dict
		public static const TUPLE:uint            = 0x74; // "t" build tuple from topmost stack items
		public static const EMPTY_TUPLE:uint      = 0x29; // ")" push empty tuple
		public static const SETITEMS:uint         = 0x75; // "u" modify dict by adding topmost key+value pairs
		public static const BINFLOAT:uint         = 0x47; // "G" push float; arg is 8-byte float encoding
		
		// public static const TRUE:uint             = "I01\n"  // not an opcode; see INT docs in pickletools.py
		// public static const FALSE:uint            = "I00\n"  // not an opcode; see INT docs in pickletools.py
		
		// Protocol 2
		
		public static const PROTO:uint            = 0x80; // identify pickle protocol
		public static const NEWOBJ:uint           = 0x81; // build object by applying cls.__new__ to argtuple
		public static const EXT1:uint             = 0x82; // push object from extension registry; 1-byte index
		public static const EXT2:uint             = 0x83; // ditto, but 2-byte index
		public static const EXT4:uint             = 0x84; // ditto, but 4-byte index
		public static const TUPLE1:uint           = 0x85; // build 1-tuple from stack top
		public static const TUPLE2:uint           = 0x86; // build 2-tuple from two topmost stack items
		public static const TUPLE3:uint           = 0x87; // build 3-tuple from three topmost stack items
		public static const NEWTRUE:uint          = 0x88; // push True
		public static const NEWFALSE:uint         = 0x89; // push False
		public static const LONG1:uint            = 0x8a; // push long from < 256 bytes
		public static const LONG4:uint            = 0x8b; // push really big long
		
		// Protocol 3 (Python 3.x)
		
		public static const BINBYTES:uint         = 0x42; // "B" push bytes; counted binary string argument
		public static const SHORT_BINBYTES:uint   = 0x43; // "C" "     "   ;    "      "       "      " < 256 bytes
	}
}